package com.example.music_player.data

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.Query

@Dao
interface PlayHistoryDao {
    @Insert
    suspend fun insertHistory(history: PlayHistory)

    @Query("SELECT * FROM play_history WHERE username = :username ORDER BY playTime DESC LIMIT 10")
    suspend fun getUserHistory(username: String): List<PlayHistory>

    @Query("DELETE FROM play_history WHERE username = :username")
    suspend fun clearUserHistory(username: String)
} 